<?php
if( ! defined('BASEPATH')) exit('No direct script access allowed');

class Notification extends CI_Controller
{
	function __construct()
	{
		parent::__construct();
		// check if user logged in
		if(!$this->ion_auth->logged_in()){
			redirect('auth/login');	}
		$this->load->model('user/notification_model');
		$this->load->library('form_validation');
	}

	function index(){
		$meta['page_title'] = 'My Notification';
		$data['notifications'] = $this->notification_model->get_all();
		$this->load->view('common/header', $meta);
		$this->load->view('user/notification',$data);
		$this->load->view('common/footer');
	}
	
	function project_log($project_id = NULL){
		$meta['page_title'] = 'Project Log';	
		$data['timeline_date'] = $this->notification_model->timeline_date($project_id);
		$data['project_id'] = $project_id;
		
		$this->load->view('common/header', $meta);
		$this->load->view('user/project_log',$data);
		$this->load->view('common/footer');
	}
	
	public function timeline_date($project_id = NULL){
		$_REQUEST['id'];
		$_REQUEST['pID'];		
		 $data['timeline_date'] = $this->notification_model->timeline_date_more($_REQUEST['id'],$_REQUEST['pID']);
		if($data['timeline_date']){
		$this->load->view('user/project_log _more',$data);	
		}		
		
	}
	

}
